import { EventAbility } from './EventAbility'

export class EventBus {
  static eventAbility = new EventAbility()

  static async emit (eventName, param) {
    await this.eventAbility.emit(eventName, param)
  }

  static clearContextEvent (route) {
    this.eventAbility.clearContextEvent(route)
  }

  static off (eventName, callback = null) {
    this.eventAbility.off(eventName, callback)
  }

  static on (eventName, callback) {
    this.eventAbility.on(eventName, callback)
  }

  static once (eventName, callback) {
    this.eventAbility.once(eventName, callback)
  }
}